import BattleAniInterPreter from "./BattleAniInterpreter"
import BattleModel from "./BattleModel"
import BattleView from "./BattleView"
import Team from "./Team"

export default class BattleManager{
    private static _i:BattleManager
    static get I():BattleManager{
        if(!BattleManager._i){
            BattleManager._i=new BattleManager()
        }
        return BattleManager._i
    }
    
    battleModel:BattleModel
    battleView:BattleView
    interpreter:BattleAniInterPreter

    init(){
        this.battleModel=new BattleModel()

        this.battleView=new BattleView()
        this.battleView.init(this.battleModel)
        
        this.interpreter=new BattleAniInterPreter(this.battleView)
    }

    startBattle(){
        console.log("开始战斗")
        this.battleModel.battle()
        let aniList=this.battleModel.aniList
        console.log('aniList')
        console.log(aniList)
        this.interpreter.playAniList(aniList)
    }
    
}